package com.neusoft.elmboot.tasks;

import com.neusoft.elmboot.mapper.OrdersMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * tasks
 * 定时任务
 */
@Component
@Slf4j
public class DelAllArrOrderEveryDay {

    @Autowired
    private OrdersMapper ordersMapper;
    @Scheduled(cron = "0 5 0 * * ? ")
    public void deleteAllOrderNoPay() {
        log.info("定时任务：逻辑删除所有未支付订单");
        ordersMapper.deleteAllOrderNoPay();
    }
}